package com.hua.base;

public class Demo03 {

    public static void main(String[] args) {
        //整数扩展 进制  二进制0b    十进制      八进制0     十六进制0x
        int a1 = 10;
        int a2 = 010;
        int a3 = 0x10;  //0~9 A~F
        int a4 = 0b10;
        System.out.println(a1);
        System.out.println(a2);
        System.out.println(a3);
        System.out.println(a4);
        System.out.println("===========================");
        //针对银行项目，不能用这两个定义变量的原因
        float f = 0.1f;
        double d = 1.0/10;
        System.out.println(f==d);
        //最好避免使用浮点数进行比较
        //用BigDecimal数学工具类
        System.out.println("===========================");
        char c1 = '在';
        int c2 = 22313;
        System.out.println((char) c2);
        System.out.println((int) c1);
        //Unicode编码
        char c3 = '\u0065';
        System.out.println(c3);
        //转义字符 \t制表符
        // \n 换行
        System.out.println("hello\nworld");
        System.out.println("============================");
        String sa = new String("hello world");
        String sb = new String("hello world");
        System.out.println(sa==sb);
        String sc = "hello world";
        String sd = "hello world";
        System.out.println(sc==sd);

        System.out.println("=============================");
        //布尔值扩展
        boolean flag = true;
        if (flag){
            System.out.println("flag is true!");
        }

    }
}
